//
//  OPReadToViewCell.m
//  OnePerson
//
//  Created by 辛亚鹏 on 16/6/12.
//  Copyright © 2016年 BWP. All rights reserved.
//

#import "OPReadToViewCell.h"
#import <UIImageView+WebCache.h>
#import "OPReadTopImage.h"

@interface OPReadToViewCell()

/** imageView */
@property (weak, nonatomic) UIImageView *coverView;


@end





@implementation OPReadToViewCell

- (UIImageView *)imageView
{
    if (!_coverView) {
        UIImageView *imageView = [[UIImageView alloc] init];

        //给图片开启交互
//        imageView.userInteractionEnabled = YES;
        imageView.frame = CGRectMake(0, 0, self.contentView.width, self.contentView.height);

        [self.contentView addSubview:imageView];
        _coverView = imageView;
    }
    return _coverView;
}

- (void)setTopImageItem:(OPReadTopImage *)topImageItem
{
    _topImageItem = topImageItem;

    [self.imageView sd_setImageWithURL:[NSURL URLWithString:topImageItem.cover] placeholderImage:[UIImage imageNamed:@"home_cover_placeholder"]];
}

@end
